<?php
/*
 * article class
 */
namespace lightblog\admin\controller;

use lightblog\engine\controller;

class adminController extends controller {
    function __construct() {
        parent::__construct();

        if (!$this->checkLogin()) {
            $this->login();
            exit(1);
        }
    }

    function checkLogin() {
        if (isset($_SESSION['uid']) && $_SESSION['uid'] > 0) {
            return true;
        }

        return false;
    }

    function login() {
        header('location: ' . route('authorize', 'login'));
    }
}
